package eventStrategies.physicalModel;

import model.IPhysicalDataModel;
import controller.IController;
import eventManager.AppEvent;
import eventStrategies.IEventResponse;
import events.ECodeEventList;
import events.physicalModel.GetRadiationEnergyEvent;
import events.physicalModel.ReplyGetRadiationEnergyEvent;

public class GetRadiationEnergyStrategy extends IEventResponse {

	private IController controller;
	private IPhysicalDataModel physModel;
	
	public GetRadiationEnergyStrategy(IController controller, IPhysicalDataModel physModel) {
		super(ECodeEventList.GET_RADIATIONENERGY);
		this.controller = controller;
		this.physModel = physModel;
	}

	@Override
	public void execute(AppEvent event) {
		GetRadiationEnergyEvent fullEvent = (GetRadiationEnergyEvent) event;
		
		controller.processOutgoingEvent(new ReplyGetRadiationEnergyEvent(fullEvent.sender, physModel.getRadiationEnergy()));
		
	}
}
